package com.test.action;

import java.util.List;

import com.test.entity.Orders;
import com.test.entity.UserInfo;
import com.test.service.OrdersService;
import com.test.util.PageUtil;

public class OrdersAction extends BaseAction {
	private OrdersService ordersService;
	private Integer choose;
	private int curpage1;
	private String stateTime;
	private String endTime;
	private int OrderState;

	public String OrdersGuanli() throws Exception {
		if (choose == 1) {
			UserInfo userInfo = (UserInfo) this.getSession().get("useradmin");
			Integer id = userInfo.getId();
			int countInteger = Integer.parseInt(ordersService
					.queryRecordAmount().toString());
			PageUtil pageUtil = new PageUtil(countInteger, 3);
			pageUtil.count(curpage1);
			List<Orders> orderlist = ordersService.queryAll2(
			pageUtil.getPageSize(), pageUtil.getCurrentPage());
			this.getRequest().put("pageUtil", pageUtil);
			this.getRequest().put("orderlist", orderlist);
			return "cartsuccess";
		}
		if (choose == 2) {
			return "";
		} else {
			return "";
		}

	}

	public OrdersService getOrdersService() {
		return ordersService;
	}

	public void setOrdersService(OrdersService ordersService) {
		this.ordersService = ordersService;
	}

	public Integer getChoose() {
		return choose;
	}

	public void setChoose(Integer choose) {
		this.choose = choose;
	}

	public int getCurpage1() {
		return curpage1;
	}

	public void setCurpage1(int curpage1) {
		this.curpage1 = curpage1;
	}

	public String getStateTime() {
		return stateTime;
	}

	public void setStateTime(String stateTime) {
		this.stateTime = stateTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public int getOrderState() {
		return OrderState;
	}

	public void setOrderState(int orderState) {
		OrderState = orderState;
	}

}
